package com.xxcxcxcx.jobsystem.common.Job.Enchanter;

import com.xxcxcxcx.jobsystem.PlayerSaveData;
import com.xxcxcxcx.jobsystem.common.Job.JobBase;
import com.xxcxcxcx.jobsystem.common.JobsClass;
import com.xxcxcxcx.jobsystem.common.capability.JobCapability;
import com.xxcxcxcx.jobsystem.common.capability.JobCapabilityProvider;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.common.util.LazyOptional;

public class Enchanter extends JobBase {
    public static String enchanter="enchanter";
    public static String Job= JobsClass.Enchanter;
    public static int ChangeLevel(Player player, int level,int min) {
        LazyOptional<JobCapability> capability = JobCapabilityProvider.getPlayerData(player);
        if(!capability.isPresent()) {
            return 1;
        }
        PlayerSaveData playerSaveData = capability.orElse(null);
        int Joblevel = playerSaveData.getLevel(Job);
        return Math.max(min+1,level+(Joblevel-5)*2);
    }
}
